package cn.wolfcode.crm.domain;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Getter;
import lombok.Setter;
import org.springframework.format.annotation.DateTimeFormat;

import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;


@Setter
@Getter
public class Saleorder {

    // 订单状态做成固定的常量
    public static final Integer NO_AUDITED = 1;
    public static final Integer AUDITED = 2;

    private Long id;

    private String orderNumber;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date saleDate;

    private String saleName;

    private BigDecimal totalNumber;// 订单总数量

    private BigDecimal totalAmount;// 订单总金额

    private Long cardId;// 会员id

    private String cardNumber;// 会员卡号

    private Integer status = AUDITED;// 订单状态

    private BigDecimal cutoff;

    private List<Saleorderitem> items = new ArrayList<>();// 对应销售的商品列表
}